package cn.com.qmth.examcloud.websocket.api;

import java.io.IOException;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import cn.com.qmth.examcloud.websocket.service.OeWebSocket;


/**
 * @author  	chenken
 * @date    	2018年4月16日 上午10:14:03
 * @company 	QMTH
 * @description WebsocketApi.java
 */
@RestController
@RequestMapping("${app.api.root}")
public class WebsocketApi {
	
	@RequestMapping(value = "/sendMessage",method = RequestMethod.GET)
	public void closeConnection(@RequestParam Long id,@RequestParam String json){
		try {
			OeWebSocket.sendMessage(id+"",json);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
}

